package zlatan_demo

object ClassDemo04 {

  class Person{
    var name:String = _  //下划线初始化变量必须加数据类型
    var age: Int = _

  }
    def main(args: Array[String]): Unit = {

      val p =new Person()
      p.name="张三"
      p.age =24

      println(p.name,p.age)


  }

}
